Many electronic devices, including portable electronic devices such as wireless communication devices, utilize a removable battery for a power source. Power failures in the power source may occur for many reasons. For example, power failure may occur when the portable electronic device is hit or as the result of a battery bounce, so the removable battery is momentarily disconnected from the electronic circuitry of the portable electronic device. Such a temporary power failure may last for several microseconds, at most one second. After recovery from the power failure, the portable electronic device typically goes through a “rebooting” process. However, all of the data before the power failure is lost. This can be very annoying to the user. The simplest solution to the above-described problem is to provide a large auxiliary power device that takes over when a power failure in main battery occurs. This is still not satisfactory to users due to cost and inconvenience of the portable electronic device.
One portable electronic device of the prior art monitors recovery from the power failure by using a battery check routine it pushes on the stack of a micro-controller. The portable electronic device pops off the battery check routine from the stack upon determining a stable recovery, while returning to an exact point in a main program it left when it detected the power failure. Unfortunately, such a portable electronic device still requires a large auxiliary power source to keep the micro-controller working.
Another portable electronic device of the prior art stores the current operating state and the current time of the device in a non-volatile RAM upon detection of the power failure. After recovery from the power failure, the stored operating information is transferred to a processor of the portable electronic device. The processor also receives the failure time from the non-volatile RAM and recovery time from a built-in clock. The processor determines that the power failure is a short break and returns the device to the operation state before the power failure based on the above-described information on the operation state of the device if the period of the power failure falls within a resumption allowable time range. This method would require a considerable amount of non-volatile RAM to save the operating state. Furthermore, the portable electronic device needs additional timer to continue operation since the processor has to determine the period of the power failure.
Therefore, what is needed is a portable electronic device with power failure recovery, unencumbered by the limitations associated with the prior art.